package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.entity.IesContractInfo;

import java.util.List;

/**
 * ============================================================<br>
 * <p> ProjectName ：dianguanjiaexportdata </p>
 * <p> @author dongjianzhao </p>
 * <p> @date 2023/3/18 </p>
 * <p> @version ：1.0 </p>
 * ============================================================<br>
 * <p>
 * IesContractInfo
 * </p>
 * ============================================================<br>
 */
@Mapper
public interface IesContractInfoMapper extends BaseMapper<IesContractInfo> {
    @Select("select * from ies_contract_info")
    List<IesContractInfo> selectAll();
    @Update(" UPDATE `ies_contract_info` i SET i.`repairnum`=#{inspectionnum} ,i.`remainnumber`=#{remainnumber} WHERE i.`contractids`= #{contractids}")
    void updateForRepairnum(@Param("inspectionnum") int inspectionnum, @Param("remainnumber") int i, @Param("contractids") String contractids);
    @Update("UPDATE `ies_contract_info` ici ,ies_service iss SET ici.serverId=iss.serverid WHERE ici.serverName=iss.servername")
    void updateServerIdByName();
    @Update("UPDATE `ies_contract_info` ici ,ies_service iss SET ici.custServerId=iss.serverid WHERE ici.custServerName=iss.servername")
    void updateCustServerIdByName();
}
